import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '申请时间',
    align:"center",
    dataIndex: 'createTime'
   },
   {
    title: '提现人',
    align:"center",
    dataIndex: 'userId_dictText'
   },
   {
    title: '提现人名称',
    align:"center",
    dataIndex: 'userName'
   },
   {
    title: '提现金额',
    align:"center",
    dataIndex: 'takeAmount'
   },
   {
    title: '审核消息',
    align:"center",
    dataIndex: 'judgeMsg'
   },
   {
    title: '审核状态',
    align:"center",
    dataIndex: 'judgeStatus_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
     {
      label: "申请时间",
      field: "createTime",
      component: 'RangePicker',
      componentProps: {
          valueType: 'Date',
          showTime:true
      },
      //colProps: {span: 6},
	},
	{
      label: "提现人",
      field: 'userId',
      component: 'JSelectMultiple',
      componentProps:{
          dictCode:"sys_user,username,id"
      },
      //colProps: {span: 6},
 	},
	{
      label: "审核状态",
      field: 'judgeStatus',
      component: 'JSelectMultiple',
      componentProps:{
          dictCode:"judge_status"
      },
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '申请时间',
    field: 'createTime',
    component: 'DatePicker',
    componentProps: {
       showTime: true,
       valueFormat: 'YYYY-MM-DD HH:mm:ss'
     },
    dynamicDisabled:true
  },
  {
    label: '提现人',
    field: 'userId',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"sys_user,username,id"
     },
  },
  {
    label: '提现人名称',
    field: 'userName',
    component: 'Input',
  },
  {
    label: '提现金额',
    field: 'takeAmount',
    component: 'InputNumber',
  },
  {
    label: '审核消息',
    field: 'judgeMsg',
    component: 'Input',
  },
  {
    label: '审核状态',
    field: 'judgeStatus',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"judge_status"
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  createTime: {title: '申请时间',order: 0,view: 'datetime', type: 'string',},
  userId: {title: '提现人',order: 1,view: 'list', type: 'string',dictTable: "sys_user", dictCode: 'id', dictText: 'username',},
  userName: {title: '提现人名称',order: 2,view: 'text', type: 'string',},
  takeAmount: {title: '提现金额',order: 3,view: 'number', type: 'number',},
  judgeMsg: {title: '审核消息',order: 4,view: 'text', type: 'string',},
  judgeStatus: {title: '审核状态',order: 5,view: 'list', type: 'string',dictCode: 'judge_status',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}